/******************************************************************************
 * Student Name: Ofri Keidar
 * Exercise Name: Ex2
 * File Description: Class Menu's interface
 ******************************************************************************/

#ifndef MENU_H_
#define MENU_H_
#include "StudentLinkedList.h"
#include "LecturerLinkedList.h"
#include "CourseLinkedList.h"

class Menu {

private:
	StudentLinkedList* m_studentList; // pointer to student database
	LecturerLinkedList* m_lecturerList; // pointer to lecturer database
	CourseLinkedList* m_courseLinkedList; // pointer to course database

	/***************************************************************************************
	 * function name: Menu(const Menu& menu)
	 * The Input: Menu to be copied
	 * The output: None
	 * The Function operation: The copy constructor is private and an empty-implementation
	 * 						   because node objects should not be sent to functions
	 * 						   by value
	 ***************************************************************************************/
	Menu(const Menu& menu){}

	/***************************************************************************************
	 * function name: studentMenu()
	 * The Input: None
	 * The output: None
	 * The Function operation: Operates student menu:
	 * 				    	   1. Add a new student
	 * 				           2. Set a new name for a student
	 * 				           3. Print students list
	 * 				           4. Exit to main menu
	 ***************************************************************************************/
	void studentMenu();

	/***************************************************************************************
	 * function name: lecturerMenu()
	 * The Input: None
	 * The output: None
	 * The Function operation: Operates lecturer menu:
	 * 				    	   1. Add a new lecturer
	 * 				           2. Set a new name for a lecturer
	 * 				           3. Print lecturer list
	 * 				           4. Exit to main menu
	 ***************************************************************************************/
	void lecturerMenu();

	/***************************************************************************************
	* function name: courseMenu()
	* The Input: None
	* The output: None
	* The Function operation: Operates course menu:
	* 				 	1. Add a new course
	* 				 	2. Add students to a course
	* 				 	3. Print details of a course
	* 				 	4. Print courses list
	* 				 	5. Exit to main menu
	***************************************************************************************/
	void courseMenu();

	/***************************************************************************************
	* function name: addStudent(const int id, const string name)
	* The Input: New student's id and name
	* The output: None
	* The Function operation: Adds student. If there is a student with given id, student is
	* 						  not added and "Error1" is printed
	***************************************************************************************/
	void addStudent(const int id, const string name);

	/***************************************************************************************
	* function name: setStudentName(const int id, const string name)
	* The Input: Id of student whose name should be change and new name
	* The output: None
	* The Function operation: Sets chosen student's name as new name. If there is not a
	* 					      student with given id, "Error2" is printed
	***************************************************************************************/
	void setStudentName(const int id, const string name);

	/***************************************************************************************
	* function name: printStudentList()
	* The Input: None
	* The output: None
	* The Function operation: For each student in student database, prints in a list each
	* 					      student's id and name
	***************************************************************************************/
	void printStudentList();

	/***************************************************************************************
	* function name: printStudentList(StudentLinkedList& listToPrint)
	* The Input: Reference to student list to be printed
	* The output: None
	* The Function operation: For each student in given student list, prints in a list each
	* 					      student's id and name
	***************************************************************************************/
	void printStudentList(StudentLinkedList& listToPrint);

	/***************************************************************************************
	* function name: addLecturer(const int id, const string name)
	* The Input: New lecturer's id and name
	* The output: None
	* The Function operation: Adds lecturer. If there is a lecturer with given id, lecturer is
	* 						  not added and "Error3" is printed
	***************************************************************************************/
	void addLecturer(const int id, const string name);

	/***************************************************************************************
	* function name: setLecturerName(const int id, const string name)
	* The Input: Id of lecturer whose name should be change and new name
	* The output: None
	* The Function operation: Sets chosen lecturer's name as new name. If there is not a
	* 					      lecturer with given id, "Error4" is printed
	***************************************************************************************/
	void setLecturerName(const int id, const string name);

	/***************************************************************************************
	* function name: printLecturerList()
	* The Input: None
	* The output: None
	* The Function operation: For each student in student database, prints in a list each
	* 						  lecturer's id and name
	***************************************************************************************/
	void printLecturerList();

	/***************************************************************************************
	* function name: addCourse(const int courseNumber, const int lecturerID)
	* The Input: New course's number and lecturer's id
	* The output: None
	* The Function operation: If there is a course with given number, "Error5" is printed
	* 						  and course is not added. If lecturer does not exist "Error6"
	* 						  is printed and course is not added.
	* 						  Otherwise, course is added
	***************************************************************************************/
	void addCourse(const int courseNumber, const int lecturerID);

	/***************************************************************************************
	* function name: addStudentsToCourse(const int courseNumber, const int numOfStudents, int** idList)
	* The Input: Number of course to add students to, number of students to add and their id's
	* The output: Number of students who were not added
	* The Function operation: If course does not exist, "Error7" is printed. For each student
	* 					      id that does not exist, "Error8" and id is printed. In that
	* 					      case id is not added
	***************************************************************************************/
	void addStudentsToCourse(const int courseNumber, const int numOfStudents, int** idList);

	/***************************************************************************************
	* function name: printCourseDetails(Course* courseToPrint)
	* The Input: None
	* The output: None
	* The Function operation: Prints lecturer's and registered students' id and name
	***************************************************************************************/
	void printCourseDetails(Course* courseToPrint);

	/***************************************************************************************
	* function name: printCourseList()
	* The Input: None
	* The output: None
	* The Function operation: For each course in course list, prints lecturer's and registered
	* 						  students' id and name
	***************************************************************************************/
	void printCourseList();

public:
	/***************************************************************************************
	 * function name: Menu()
	 * The Input: None
	 * The output: None
	 * The Function operation: Creates a new menu
	 ***************************************************************************************/
	Menu();

	/***************************************************************************************
	 * function name: ~Menu()
	 * The Input: None
	 * The output: None
	 * The Function operation: Destructs the menu object
	 ***************************************************************************************/
	~Menu();

	/***************************************************************************************
	 * function name: start()
	 * The Input: None
	 * The output: None
	 * The Function operation: Operates main menu:
	 * 					       1. Student menu
	 * 					       2. Lecturer menu
	 * 					       3. Course menu
	 * 					       4. Exit program
	 ***************************************************************************************/
	void start(); // start the program
};


#endif
